package youbff.cloud.core.utils;

import java.util.ResourceBundle;

import org.apache.log4j.Logger;

import youbff.cloud.core.dto.CloudCommonAuthDto;

/**
 * session工具类
 * @author lixuefeng
 * @email youbff@163.com
 * @time 2018年1月8日 下午5:26:29
 */
public class SessionUtils {
    
    private static Logger logger = Logger.getLogger(SessionUtils.class);
    private static String methodName = "session工具";
    private static final ResourceBundle bundle = java.util.ResourceBundle.getBundle("config");
    private static RedisUtil redisUtil;

    /**
     * 取得账户信息
     * @author lixuefeng
     * @email youbff@163.com
     * @time 2018年1月8日 下午6:04:12
     * @param userNameOrMobile
     * @return
     */
    public static CloudCommonAuthDto getAuthInfo(String userNameOrMobile){
        userNameOrMobile = userNameOrMobile.toLowerCase();
        CloudCommonAuthDto result = (CloudCommonAuthDto) redisUtil.get(userNameOrMobile);
        return result;
    }
    
    public static void setRedisUtil(RedisUtil redisUtilOut) {
        redisUtil = redisUtilOut;
    }
}
